<template>
  <div>
    <div id="dayinWo" >
      根据ID请打印我1
      <canvas id="myCanvas" width="200" height="100" style="border:1px solid #d3d3d3;">
        您的浏览器不支持 HTML5 canvas 标签。</canvas>
      sss
    </div>
    <div ref="dayinWo">
      根据ref请打印我2
    </div>
    <div id="dayinWo2" class="no-print">
      别打印我
    </div>
    <mc-print print-id="dayinWo" canvas="true">打印1</mc-print>
    <mc-print print-ref="dayinWo">打印2</mc-print>
  </div>
</template>

<script>
import McPrint from './components/McPrint'
export default {
  data(){
    return {
      msg: "欢迎体验vue项目打包到MagicaCoder布局器中"
    }
  },
  components:{
    McPrint
  },
  mounted:function(){
    var c=document.getElementById("myCanvas");
    var ctx=c.getContext("2d");
    ctx.moveTo(0,0);
    ctx.lineTo(200,100);
    ctx.stroke();
  }
}
</script>

<style>

</style>
